package com.teaching.teachingsupport.common.pojo.dataobject;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@TableName("homework")
public class Homework {
    @TableId(type = IdType.AUTO)
    private Long homeworkId;
    
    @TableField("course_id")
    private Long courseId;
    
    @TableField("title")
    private String title;
    
    @TableField("publisher_id")
    private Integer publisherId;
    
    @TableField("publish_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime publishTime;
    
    @TableField("deadline")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime deadline;
    
    @TableField("total_score")
    private Integer totalScore;
    
    @TableField("status")
    private String status;
    
    @TableField("create_time")
    private LocalDateTime createTime;
    
    @TableField("update_time")
    private LocalDateTime updateTime;

    // 非数据库字段，用于展示
    @TableField(exist = false)
    private String courseName;        // 课程名称
    
    @TableField(exist = false)
    private String publisherName;     // 发布者姓名
    
    @TableField(exist = false)
    private String courseInfo;        // 课程信息
    
    @TableField(exist = false)
    private String submitStatus;      // 提交状态（未提交/已提交/已批改）
    
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime submitTime; // 提交时间
    
    @TableField(exist = false)
    private Integer score;           // 得分
    
    @TableField(exist = false)
    private String scoreDisplay;     // 分数显示（例如：79/100分）
    
    @TableField(exist = false)
    private String remainingTime;    // 剩余时间显示
    
    @TableField(exist = false)
    private String statusDisplay;    // 状态显示（例如：距离截止还有1天10小时40分钟）
    
    @TableField(exist = false)
    private Integer semesterId;      // 学期ID
    
    @TableField(exist = false)
    private String semesterName;     // 学期名称
}
